/**
 * 封装后端的 API
 */
import ajax from './ajax'
// const BASE_URL = '/api/patient'
const BASE_URL = 'http://121.5.18.13:8080/patient'

// 患者注册
export const reqRegister = (data) => ajax(`${BASE_URL}/register`, data, 'POST')
// 登录
export const reqLogin = (data) => ajax(`${BASE_URL}/login`, data, 'POST')
// 获取当前登录用户信息
export const reqPatientInfo = () => ajax(`${BASE_URL}/getPatientInfo`)
// 获得指定医生的信息
export const reqDoctorInfo = (data) => ajax(`${BASE_URL}/getDoctorInfo`, data, 'POST')
// 患者完善信息
export const reqSetInfo = (data) => ajax(`${BASE_URL}/setInfo`, data, 'POST')
// 登出
export const reqLogout = () => ajax(`${BASE_URL}/logout`)

// 患者预约挂号
export const reqOrderDoctor = (data) => ajax(`${BASE_URL}/orderDoctor`, data, 'POST')
// 患者取消预约
export const reqCancelOrder = (data) => ajax(`${BASE_URL}/cancelOrder`, data, 'POST')
// 患者查看可预约情况/查看医生列表
export const reqDoctorsList = () => ajax(`${BASE_URL}/doctorsList`)
// 患者获取自己的所有预约
export const reqListOrders = () => ajax(`${BASE_URL}/listOrders`)

// 医生端，获得预约该医生的所有患者
export const reqListPatients = () => ajax(`${BASE_URL}/listPatients`)
// 医生完成诊断
export const reqDiagnose = (data) => ajax(`${BASE_URL}/diagnose`, data, 'POST')

// 患者每日填报
export const reqMonitor = (data) => ajax(`${BASE_URL}/monitor`, data, 'POST')
// 患者接收消息推送
export const reqPushNews = () => ajax(`${BASE_URL}/pushNews`)
